﻿using KTWpm.Management.Domain.Entities;
using KTWpm.Management.Domain.ValueObjects;

namespace KTWpm.Management.Domain;

public interface IBreadService
{
    Bread? GetBreed(Guid id);
}

public class FakeBreedService : IBreadService
{
    public readonly List<Bread> Breeds = [
         new Bread(Guid.NewGuid(),
             "Baguette",
          new WeightRange(12.5m,20.6m),
          new WeightRange(12m,20m)),
        new Bread(Guid.NewGuid(),
             "Staff",
          new WeightRange(22.5m,34.6m),
          new WeightRange(20m,30m)),
        ];

    public Bread? GetBreed(Guid id)
    {
        if (id == Guid.Empty)
        {
            throw new ArgumentException("Bread is not valid.");
        }
        var result = Breeds.Find(x => x.Id == id);
        return result ?? throw new ArgumentException("Bread not found.");
    }
}


public interface IManagementRepository
{
    Pet? GetById(Guid id);
    IEnumerable<Pet> GetAll();
    void Insert(Pet pet);
    void Update(Pet pet);
    void Delete(Pet pet);
}